home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga News 95
/
Amiga News 95.iso
/
dpat
/
dpat36
/
memophone
/
mémophone
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1992-09-02
|
7KB
|
291 lines
'**************************************
'* *
'* MEMOPHONE :Répertoire et composeur *
'* *
'* téléphonique *
'* *
'* par Joseph Costa et j2c pour: *
'* *
'* AmigaNews *
'* *
'**************************************
50 :
CLS: CLEAR
PALETTE 1, 0.9, 0.8 ,0.8
PALETTE 2, 0.1,0 ,0.55
COLOR 1,2
mire:
CLOSE #1
CLS:FONCT=0
GOSUB 1000:B=0
PRINT:PRINT:PRINT
PRINT " INITIALISER ANNUAIRE"
PRINT:
PRINT " CREER UNE NOUVELLE ENTREE"
PRINT:
PRINT " RENSEIGNEMENT COMPLEMENTAIRE"
PRINT:
PRINT " COMPOSITION TEL. (MANU.)"
PRINT:
PRINT " COMPOSITION TEL. (AUTO.)"
PRINT:
PRINT " ANNUAIRE TELEPHONIQUE"
PRINT:
PRINT " FIN DU PROGRAMME"
PRINT:PRINT:
LINE (175,27)-(434,153),,B
RP:
ON ERROR GOTO 3000
OPEN "DONNEES.ANNUAIRE" AS #1 LEN=70
FIELD #1,1 AS K$,15 AS D$,14 AS P$,5 AS Q$,20 AS r$,15 AS V$
GOSUB CMO
IF(FONCT>0) AND (FONCT<8) THEN GOTO DEBUT
GOTO RP
DEBUT:
ON FONCT GOSUB 100,200,300,400,500,600,700
IF FONCT<7 THEN GOTO mire
END
100 :
CLS:GOSUB 1000:LOCATE 7,1
PRINT" *****************************************************************"
PRINT" * *"
PRINT" * ATTENTION : CE MENU EFFACE LE CONTENU TOTAL DE L'ANUAIRE *"
PRINT" * *"
PRINT" *****************************************************************"
PRINT""
PRINT""
PRINT""
INPUT " EN ETES-VOUS CERTAIN ";confirm$
IF confirm$<>"oui" AND confirm$<>"OUI" THEN RETURN
LSET K$=CHR$(255)
FOR I=1 TO 100
PUT #1,I
NEXT I
RETURN
200 :
CLS:GOSUB 1000:GOSUB 600:GOSUB nom
IF ASC(K$)<>255 THEN INPUT " Ce n° de mémoire éxiste déja. Voulez-vous l'éffaçer ";confirm$
IF ASC(K$)<>255 AND UCASE$(confirm$)<>"OUI" THEN RETURN
LSET K$ = CHR$(0):CLS:PRINT:PRINT,
INPUT " Nom et prénom ";DESCRIPTION$
LSET D$ = DESCRIPTION$:PRINT:PRINT,
INPUT " Ville";VILLE$
LSET V$=VILLE$:PRINT:PRINT,
INPUT " Code postal";CODE$
LSET Q$ = CODE$:PRINT:PRINT,
INPUT " Adresse";adresse$
LSET r$ = adresse$:PRINT:PRINT,
CLS:GOSUB CADRE:GOSUB TL:
LOCATE 21,15:PRINT "Entrer le numéros à mémoriser";
INPUT " ";TE$
LSET P$ =TE$:PRINT
PUT #1,nom%
RETURN
300 :
GOSUB 600
GOSUB 1000
GOSUB nom
IF ASC(K$)=255 THEN GOSUB NUL:RETURN
CLS:LINE(120,45)-(470,150),,B
LOCATE 9,22
PRINT" NOM ";D$:PRINT
PRINT TAB(22); " N° tél. ";P$: PRINT
PRINT TAB(22);" Adresse ";r$:PRINT
PRINT TAB(22);" Code postal ";Q$:PRINT
PRINT TAB(22);" Ville ";V$:PRINT
PRINT :PRINT:CR=200
GOSUB TI
RETURN
400 :
CLS:GOSUB 1000:GOSUB CADRE:GOSUB TL:
LOCATE 21,16:PRINT "Entrer le numéros à composer";
INPUT " ";a$:IF LEN(a$)<2 THEN RETURN
CLS:LOCATE 6,19
PRINT"Le numéros demandé est : ";a$
PRINT:PRINT:
B=0:RS=LEN(a$)
GOSUB STR
RETURN
500 :
GOSUB 600
START:
LOCATE 21,16
INPUT " Entrer le n° de mémoire ";I
IF I<0 OR I>100 THEN RETURN :B=0:D=0:
ON ERROR GOTO 3000
GET #1,I
IF ASC(K$)=255 THEN GOSUB NUL:RETURN
CLS:LOCATE 6,19
PRINT"Le numéros demandé est : ";P$
a$=P$:PRINT:PRINT:RS=11
STR:
LINE (90,20)-(500,90),,B
PRINT TAB (19);"Le numéros composé est :";
STE:D=0:c=0:T=RS
PRINT ".";
ST:
B=B+1
c$=MID$(a$,B,1)
IF c$="." OR c$=")" THEN c$="11"
IF c$=" " THEN c$="11"
IF c$="("THEN GOSUB SUB1:GOSUB SUB12:GOSUB INTER
CHOIX%=VAL(c$):D=D+1
IF D=3 THEN GOTO STE
CR=150
IF B>T THEN GOSUB TI:RETURN
STH:
IF CHOIX%=0 THEN CHOIX%=10
ON CHOIX% GOSUB SUB1, SUB2, SUB3, SUB4, SUB5, SUB6, SUB7, SUB8, SUB9, SUB10, SUB11, SUB12
IF CHOIX%<11 THEN CHOIX%=12:GOTO STH
GOTO ST
SUB1:
SOUND 1209,2,255,0:SOUND 697,2,255,1:PRINT"1";
RETURN
SUB2:
SOUND 1336,2,255,0:SOUND 697,2,255,1:PRINT"2";
RETURN
SUB3:
SOUND 1477,2,255,0:SOUND 697,2,255,1:PRINT"3";
RETURN
SUB4:
SOUND 1209,2,255,0:SOUND 770,2,255,1:PRINT"4";
RETURN
SUB5:
SOUND 770,2,255,0:SOUND 1336,2,255,1:PRINT"5";
RETURN
SUB6:
SOUND 770,2,255,0:SOUND 1477,2,255,1:PRINT"6";
RETURN
SUB7:
SOUND 1209,2,255,0:SOUND 852,2,255,1:PRINT"7";
RETURN
SUB8:
SOUND 852,2,255,0:SOUND 1336,2,255,1:PRINT"8";
RETURN
SUB9:
SOUND 1477,2,255,0:SOUND 852,2,255,1:PRINT"9";
RETURN
SUB10:
SOUND 941,2,255,0:SOUND 1336,2,255,1:PRINT"0";
RETURN
SUB11:
SOUND 0,0,0,0:SOUND 0,0,0,1:PRINT ".";
RETURN
SUB12:
SOUND 0,1,0,0:SOUND 0,1,0,1:CHOIX%=11
RETURN
INTER:
RS=14:D=0:c$="11"
J=0:GOSUB SUB12:GOSUB SUB6
NTE:
W=W+1:IF W<800 THEN GOTO NTE
W=0
RETURN
600 :
GOSUB CADRE:GOSUB 1000
LOCATE 8,10:F=0:
FOR I=1 TO 100
GET #1,I
IF ASC(K$)=255 GOTO 625
PRINT TAB(15);I;TAB(22);D$;TAB(46);P$;
F=F+1:K=K+1
IF MOUSE(0)=-1 THEN GOTO 2000
IF F=10 THEN SLEEP:GOTO 2000
CR=150
625 :
NEXT I
CR=150:GOSUB TI
RETURN
700 :
CLS:GOSUB 1000
PRINT:PRINT:PRINT:PRINT:
PRINT TAB(33);" à bientot"
PRINT:PRINT:
PRINT TAB(30);"( n'oublier pas )"
PRINT:
PRINT TAB(29);"programme écrit par :"
PRINT:
PRINT TAB(35);"JOSEPH"
CR=100:GOSUB TI:CLOSE #1:CLS
SYSTEM
RETURN
nom:
LOCATE 21,16
INPUT "Veuillez entrer le n° de mémoire ",nom%
IF (nom%<1) OR (nom%>100) THEN 50
GET #1,nom%
RETURN
NUL:
CR=100
LOCATE 22,20:PRINT " Numéros de mémoire non existant"
GOSUB TI
RETURN
CMO:
O$=INKEY$
MOUSE ON
IF MOUSE(0)>-1 THEN CMO
IF ABS(X-MOUSE(1)) > 1 THEN MP
IF ABS(Y-MOUSE(2)) < 3 THEN CMO
MP:
X=MOUSE(1): Y=MOUSE(2)
IF Y>38 AND Y<46 AND X>173 AND X<410 THEN FONCT=1
IF Y>55 AND Y<64 AND X>173 AND X<410 THEN FONCT=2
IF Y>71 AND Y<79 AND X>173 AND X<410 THEN FONCT=3
IF Y>86 AND Y<94 AND X>173 AND X<410 THEN FONCT=4
IF Y>102 AND Y<110 AND X>173 AND X<410 THEN FONCT=5
IF Y>119 AND Y<126 AND X>173 AND X<410 THEN FONCT=6
IF Y>135 AND Y<143 AND X>173 AND X<410 THEN FONCT=7
MOUSE OFF
RETURN
1000 :
LOCATE 1,69 :PRINT TIME$:PRINT TAB(68)DATE$
RETURN
2000 :SLEEP:F=0:
IF MOUSE(0) =-1 THEN GOTO TI:
GOSUB CADRE
GOTO 625
CADRE:
CLS:K=0:PRINT :PRINT :PRINT:PRINT :
PRINT TAB(15);"N°mem";TAB(23);"NOM ET PRENOM";TAB(45);"N° TELEPHONE":PRINT :
LINE (110,30)-(310,150),,B
LINE (310,30)-(490,150),,B
LINE (110,40)-(490,40)
LINE (155,30)-(155,150)
RETURN
TI:IF MOUSE(0) =-1 THEN RETURN
LOCATE 21,16:PRINT " Attente !!! "
J=J+1:IF J<CR THEN GOTO TI:
J=0:CR=0:RETURN
TL:
LOCATE 5,15
PRINT " [ Exemple ] "
LOCATE 9,21:PRINT "Province --> Paris (1)12.34.56.78 "
LOCATE 11,21:PRINT " Paris --> Prov. ().12.34.56.78 "
LOCATE 13,21:PRINT " Paris --> Paris 12.34.56.78 "
LOCATE 15,21:PRINT " Prov. --> Prov. 12.34.56.78 "
LINE (310,30)-(310,150)
RETURN
3000 :
IF (ERR=63) AND (ERL=90) THEN CLOSE #1
RESUME mire: